<?php $this->widget('zii.widgets.grid.CGridView', array(
    'id'=>'branch-grid',
    'dataProvider'=>$dataProvider,
    'filter'=>$model,
    'ajaxUpdate'=> true,
    //'template' => "{items} {pager}",
    'itemsCssClass' => 'table table-striped table-bordered',
    'pagerCssClass' => 'pagination pagination-centered',
    'pager'=>array(
        'class'=>'CLinkPager',
        'htmlOptions' => array(
            'class' => '',
        ),
        'hiddenPageCssClass' => 'disabled',
        'selectedPageCssClass' => 'active',
        'maxButtonCount'    =>  8,
        'header'            => FALSE,

    ),
    'loadingCssClass' => '',
    'beforeAjaxUpdate'=>'function(id,options){
        $("#ajax-loading").fadeIn();    
    }',
    'afterAjaxUpdate'=>'function(id,options){
        $("#ajax-loading").fadeOut();    
    }',
    'columns'=>array(
      array(
        'header'=>'No.',
        'value'=>'$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)',
      ),
        array(
            'name' => 'id',
            'type'      =>  'html',
            'value' => '$data->id',
            'headerHtmlOptions' => array('style' => 'width: 40px'),
        ),
        array(
            'name' => 'image',
            'type'      =>  'html',
            'value' => 'Chtml::image($data->getImgUrl($data->id,"300.jpg"))',
            'filter' => FALSE,
        ),
        array(
            'name' => 'title',
            'type'      =>  'html',
            'value' => '$data->title',
        ),
        array(
            'name' => 'handbookCats',
            'type'      =>  'raw',
            'value' => '$data->CatLabelList',
            'filter' => HandbookPostCat::model()->getData()
        ),
        array(
            'name' => 'cities',
            'type'      =>  'raw',
            'value' => '$data->citiesLabelList',
            'filter' => City::model()->data
        ),
        array(
            'name' => 'manager_id',
            'type'      =>  'html',
            'value' => '$data->manager->name',
        ),
        array(
            'name' => 'created',
            'type'      =>  'html',
            'value' => '$data->created'
        ),
        array(
            'name' => 'status',
            'type'      =>  'raw',
            'value' => '$data->status',
            'filter' => array('ENABLE'=>'ENABLE','DISABLE'=>'DISABLE')
        ),
        array(
            'class'=>'CButtonColumn',
            'template'=>'{update}',
        ),
    ),
)); ?>             